import com.zxy.pojo.TravelItem;
import com.zxy.service.TravelItemService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:*.xml")
public class test {
    @Autowired
    TravelItemService travelItemService;

    @Test
    public void test() {
        TravelItem travelItem = new TravelItem();
        travelItem.setAge("11");
        travelItem.setName("a");
        travelItem.setAttention("a");
        travelItem.setCode("a");
        travelItem.setPrice(11.1f);
        travelItem.setSex("男");
        travelItem.setType("a");
        travelItem.setRemark("aa");
        travelItemService.add(travelItem);
    }
}
